package com.wande.dataplatform.filecollection.domain.bo;

import com.wande.common.core.validate.AddGroup;
import com.wande.common.core.validate.EditGroup;
import com.wande.common.mybatis.core.domain.BaseEntity;
import com.wande.dataplatform.filecollection.domain.dto.FieldMapping;
import com.wande.dataplatform.filecollection.domain.dto.ValidationRule;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 数据映射规则业务对象
 *
 * @author wande
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class MappingRuleBo extends BaseEntity {

    /**
     * 主键ID
     */
    @NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 规则名称
     */
    @NotBlank(message = "规则名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String ruleName;

    /**
     * 规则编码
     */
    @NotBlank(message = "规则编码不能为空", groups = {AddGroup.class, EditGroup.class})
    private String ruleCode;

    /**
     * 文件类型
     */
    @NotBlank(message = "文件类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String fileType;

    /**
     * 解析器配置
     */
    private String parserConfig;

    /**
     * 字段映射列表
     */
    @NotNull(message = "字段映射不能为空", groups = {AddGroup.class, EditGroup.class})
    private List<FieldMapping> fieldMappings;

    /**
     * 校验规则列表
     */
    private List<ValidationRule> validationRules;

    /**
     * 备注
     */
    private String remark;
}
